const tokenKey = 'token'
const refreshTokenKey = 'refreshToken'
const expiresTimeKey = 'expiresTime'
const tenantIdKey = 'tenantId'
const dictionaryKey = 'dictionary'
const permissionsKey = 'permissions'

export const setToken = (token) => {
	uni.setStorageSync(tokenKey, token)
}

export const getToken = () => {
	return uni.getStorageSync(tokenKey)
}

export const removeToken = () => {
	uni.removeStorageSync(tokenKey)
}

export const setRefreshToken = (refreshToken) => {
	uni.setStorageSync(refreshTokenKey, refreshToken)
}

export const getRefreshToken = () => {
	return uni.getStorageSync(refreshTokenKey)
}

export const removeRefreshToken = () => {
	uni.removeStorageSync(refreshTokenKey)
}

export const setExpiresTime = (expiresTime) => {
	uni.setStorageSync(expiresTimeKey, expiresTime)
}

export const getExpiresTime = () => {
	return uni.getStorageSync(expiresTimeKey)
}

export const removeExpiresTime = () => {
	uni.removeStorageSync(expiresTimeKey)
}

export const setTenantId = (tenantId) => {
	uni.setStorageSync(tenantIdKey, tenantId)
}

export const getTenantId = () => {
	return uni.getStorageSync(tenantIdKey)
}

export const removeTenantId = () => {
	uni.removeStorageSync(tenantIdKey)
}

export const setDictionary = (dictionary) => {
	uni.setStorageSync(dictionaryKey, dictionary)
}

export const getDictionary = () => {
	return uni.getStorageSync(dictionaryKey)
}

export const removeDictionary = () => {
	uni.removeStorageSync(dictionaryKey)
}

export const setPermissions = (permissions) => {
	uni.setStorageSync(permissionsKey, permissions)
}

export const getPermissions = () => {
	return uni.getStorageSync(permissionsKey)
}

export const removePermissions = () => {
	uni.removeStorageSync(permissionsKey)
}